import os
from locust import HttpUser, task, between, FastHttpUser


class MyUser(FastHttpUser):
    wait_time = between(1, 2)
    host = 'https://gateway-beta.fengjinketang.com'

    @task(10)
    def receive_coupon(self):
        headers = {
            "authority": "gateway-beta.fengjinketang.com",
            "ostype": "h5",
            "content-type": "application/json;charset=utf-8",
            "token": "_v3_2dd383c2-1a19-4006-a61a-a531b09103d7",
        }
        data = {"data":{"roomId":"r_h860ntnkcg0273"}}

        self.client.post(
            "/api/edu-fengjin-sale-web/common/aggregationV2",
            headers=headers,
            json=data,
        )

    # if __name__ == "__main__":
    #     os.system('locust -f recive.py --host=https://gateway.fengjinketang.com')
